<template>
    <div>
        <h1>右边zhilong</h1>
        <!-- <button @click="$router.push('/register')">跳转到注册</button> -->
        <!-- <button @click="$router.push({ name: 'register' })">跳转到注册</button> -->
        <button @click="goRegister">跳转到注册</button>
    </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { useRoute, useRouter } from "vue-router";

export default defineComponent({
    setup() {
        const route = useRoute();
        console.log(route);
        console.log(route.params.id);

        const router = useRouter();

        const goRegister = () => {
            router.push({name:"register"});
        }
        return {
            goRegister,
        };
    }
})
</script>

<style scoped>

</style>